//
//  CellOfClickYongHu.m
//  SeeTheWorld
//
//  Created by dllo on 16/3/1.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "CellOfClickYongHu.h"
#import "ModelOfClickYongHu.h"
#import "PCH.pch"
#import <UIImageView+WebCache.h>


@interface CellOfClickYongHu ()

@property (nonatomic, retain)UIImageView *imageOfBack;
@property (nonatomic, retain)UILabel *label;

@end

@implementation CellOfClickYongHu


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.imageOfBack = [[UIImageView alloc] init];
        [self.contentView addSubview:self.imageOfBack];
        [_imageOfBack release];
        
        self.label = [[UILabel alloc] init];
        [self.contentView addSubview:self.label];
        [_label release];
        self.label.textAlignment = 1;
        self.label.font = [UIFont systemFontOfSize:25];
        self.label.textColor = [UIColor whiteColor];
        
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    self.imageOfBack.frame = self.contentView.frame;
    self.label.frame = CGRectMake(10, self.contentView.frame.size.height / 2 - 20, self.contentView.frame.size.width - 20, 30);
}

- (void)passModel:(ModelOfClickYongHu *)model {
    
    [self.imageOfBack sd_setImageWithURL:[NSURL URLWithString:model.front_cover_photo_url] placeholderImage:[UIImage imageNamed:@"1f178a82b9014a90e9109296ad773912b31beeeb"]];
    self.label.text = model.name;
}

@end
